× Main Home Install-schroot Node-dh_make Npm2deb Environment Lxc Install Git Sbuild Next
☰ Debian Packaging

DEBIAN PACKAGING

A Debian "package", or a Debian archive file, contains the executable files, libraries, and documentation associated with a particular suite of program or set of related programs. Normally, a Debian archive file has a filename that ends in .

Debian Unstable Install - schroot
$ sudo apt install schroot debootstrap

$ sudo debootstrap sid /srv/chroot/debian-sid

$ sudo nano /etc/schroot/chroot.d/debian-sid


paste this
///////////////////////////////////////////////////
# schroot chroot definitions.
# See schroot.conf(5) for complete documentation of the file format.
#
# Please take note that you should not add untrusted users to
# root-groups, because they will essentially have full root access
# to your system. They will only have root access inside the chroot,
# but that's enough to cause malicious damage.
#
# The following lines are examples only. Uncomment and alter them to
# customise schroot for your needs, or create a new entry from scratch.
#
[debian-sid]
description=Debian Sid for building packages suitable for uploading to debian
type=directory
directory=/srv/chroot/debian-sid
users=
root-groups=root
personality=linux
preserve-environment=true
///////////////////////////////////////////////////
login use this command
$ sudo schroot -c debian-sid (to start)

$ schroot -c debian-sid(to start)

......................................................
For more info click here
......................................................

Debian Packaging of node project use dh_make
  • Initial Setup
  • schroot -c debian-sid
  • mkdir packaging
  • cd packaging/
  • wget link here
  • mv v7.0.0.tar.gz node-pretty-ms_7.0.0.orig.tar.gz
  • tar -zxvf node-pretty-ms_7.0.0.orig.tar.gz
  • mv pretty-ms-7.0.0 node-pretty-ms-7.0.0
  • cd node-pretty-ms-7.0.0/
  • sudo apt-get install dh-make
  • dh_make
  • dpkg-source -b .
  • dpkg-buildpackage

  • Install and show and remove
  • dpkg -i ../node-pretty-ms_7.0.0-1_amd64.deb
  • dpkg -L node-pretty-ms
  • apt remove node-pretty-ms
  • rm ../node-pretty-ms_7.0.0-1_amd64.deb

  • Additional changes need
  • vim debian/install
  • index.js usr/share/nodejs/pretty-ms
  • vim debian/control
  • change architecture any -> all
  • change homepage link here
  • vim debian/rules
  • #first line
  • %:
  • dh $@
  • vim debian/copyright
  • format is available in the website

  • Error Correction
  • apt-get install lintian
  • lintian
  • N - normal
  • E - Error
  • W - Warning
  • ......................................................
    For more info click here
    ......................................................

Npm2Deb
$ sudo apt-get install npm2deb
  • Project start
  • mkdir packaging
  • cd packaging/
  • wget link here (not needed for npm2deb)
  • npm2deb create pretty-ms
  • use lintian and correct errors
......................................................
For more info click here
......................................................

Environment Configuration
$ vim ~/.bashrc

paste this in variables section
......................................................

export DEBEMAIL=your@email.domain
export DEBFULLNAME='Your Name'
alias lintian='lintian -iIEcv --pedantic --color auto'
alias git-import-dsc='git-import-dsc --author-is-committer --pristine-tar'
alias clean='fakeroot debian/rules clean'

......................................................
$ source ~/.bashrc

......................................................
For more info click here
......................................................

lxc Install
$ sudo apt-get install lxc

$ sudo apt-get install lxc lxctl lxc-templates

$ sudo apt-get install -qy libvirt-clients libvirt-daemon-system iptables ebtables dnsmasq-base # if libvirt-client is not available, try libvirt-bin

$ systemctl status libvirtd

$ systemctl start libvirtd (not started)

$ sudo lxc-create -n debian-sid -t download -- --dist debian --release sid

$ sudo lxc-start -n debian-sid (to start)

$ sudo lxc-attach -n debian-sid (to attach)

var/lib/lxc -- lxc directory

......................................................
For more info click here
......................................................

git track
create project before make any change do it first

(got to the directory that contain .dsc file)

$ rm -rf node-pretty-ms

$ gbp import-dsc --pristine-tar node-pretty-ms_7.0.0-1.dsc

error: found (unknown system group 'Debian-exim')

$ sudo vim /var/lib/dpkg/statoverride

for reference
default mirror site is :

deb.debian.org

$cd node-pretty-ms

$git tag -d debian/7.0.0-1

$dpkg-source -b .

$dpkg-buildpackage

error: Unmet build dependencies: pkg-js-tools

$ sudo apt-get install pkg-js-tools

if any problem correct it then

$dpkg-buildpackage

$git status

$git add debian/file_name

$git commit -m "in debian/rules file updated"

$lintian

or

$lintian ../node-pretty-ms_7.0.1-1_amd64.changes

resolve problems and build then add the file and commit the changes

......................................................
For more info click here
......................................................

NOW PUSH THE PROJECT TO SALSA

    Command line instructions. You can also upload existing files from your computer using the instructions below. Create an account in salsa then create new project.

  • Git global setup
  • git config --global user.name "user-name"
  • git config --global user.email "mail@example.com"
  • Create a new repository
  • git clone link
  • cd pretty-ms
  • touch README.md
  • git add README.md
  • git commit -m "add README"
  • git push -u origin master
  • Push an existing folder
  • cd existing_folder
  • git init
  • git remote add origin link
  • git add .
  • git commit -m "Initial commit"
  • git push -u origin master
  • Push an existing Git repository
  • cd existing_repo
  • git remote rename origin old-origin
  • git remote add origin link
  • git push -u origin --all
  • git push -u origin --tags
  • ......................................................
    For more info click here
    ......................................................

Sbuild - build Package
$ sudo apt-get install sbuild schroot debootstrap

$ sudo sbuild-adduser jobin

$ cp link

$ sudo apt install apt-cacher-ng

$ newgrp sbuild (or logout then login again)

$ sudo auto-apt-proxy sbuild-createchroot --include=eatmydata,ccache,gnupg,auto-apt-proxy unstable /srv/chroot/unstable-amd64-sbuild http://deb.debian.org/debian

$ (go to packaging directory that contain debian folder)

$ sbuild -A -d unstable

......................................................
Problems & Solutions
P: command not found : auto-apt-proxy
S: sudo apt-get install auto-apt-proxy
P: if sbuild install problem occure
S: sudo apt install --reinstall sbuild
P:: /srv/chroot/unstable-amd64-sbuild is not empty
S: /srv/chroot/unstable-amd64-sbuild delete ചെയ്തതിനു് ശേഷം കൂടാതെ /etc/schroot/chroot.d/unstable-amd64* കൂടി delete ചെയ്യണം. ശേഷം sbuild-createchroot ആണു് കൊടുക്കേണ്ടതു്.
P: can't find module pkg-js-tools
S: sudo apt-get install pkg-js-tools
......................................................

sometimes need this
$ sudo apt install apt-file

$ sudo apt-file update

$ sudo apt-file find file_name

......................................................
Reference
Packaging sbuild
sbuild
AptCacherNg
unknown-user-in-statoverride-file
......................................................